package com.spark.colliery.module.mine.activity

import android.app.Activity
import android.content.Intent
import android.os.Bundle
import com.spark.colliery.R
import com.spark.common.BaseActivity
import com.spark.common.helper.Picker
import com.spark.colliery.module.mine.fragment.ProfileMainFragment
import kotlinx.android.synthetic.main.act_profile.*

/**
 * Profile
 */
class ProfileActivity : BaseActivity() {
    private var profileMainFragment: ProfileMainFragment? = null

    companion object {
        fun actionStart(host: Activity) {
            val intent = Intent(host, ProfileActivity::class.java)
            host.startActivity(intent)
        }
    }

    override fun contentResId(): Int {
        return R.layout.act_profile
    }


    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        iv_back.setOnClickListener { finish() }
        profileMainFragment = ProfileMainFragment.newInstance()
        loadRootFragment(R.id.fl_content,profileMainFragment!!)
    }

    override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
        Picker.onActivityResulted(this, requestCode, resultCode, data)
        super.onActivityResult(requestCode, resultCode, data)
    }

    fun changeTitle(titleStr: String) {
        tv_profile_title!!.text = titleStr
    }
}
